﻿#ifndef ETHERNET_H
#define ETHERNET_H

#include <QObject>
#include "device.h"

class Ethernet : public Device
{
    Q_OBJECT
public:
    explicit Ethernet(QObject *parent = nullptr);

    QString strIP() const;
    void setStrIP(const QString &newStrIP);
    int nPort() const;
    void setNPort(int newNPort);

public:
    virtual void initDevice() override;
    virtual void writeXML(QXmlStreamWriter& writer) override;
    virtual void readFromXML(QXmlStreamReader& reader) override;
    virtual void writeData(const QByteArray &data) override;

signals:
    void strIPChanged();
    void nPortChanged();

private:
    QString         m_strIP;
    int             m_nPort;


    Q_PROPERTY(QString strIP READ strIP WRITE setStrIP NOTIFY strIPChanged FINAL)
    Q_PROPERTY(int nPort READ nPort WRITE setNPort NOTIFY nPortChanged FINAL)
};

#endif // ETHERNET_H
